package com.tcoiss.kettle.api;

import com.alibaba.fastjson.JSONObject;
import com.tcoiss.common.core.constant.ServiceNameConstants;
import com.tcoiss.kettle.api.factory.RemoteKettleTransFallbackFactory;
import com.tcoiss.kettle.common.povo.PageOut;
import com.tcoiss.kettle.common.povo.QueryHelper;
import com.tcoiss.kettle.common.povo.Result;
import com.tcoiss.kettle.api.request.TransReq;
import com.tcoiss.kettle.api.response.TransRes;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 转换管理API
 *
 * @author lyf
 */
@FeignClient(contextId = "remoteKettleTransService", value = ServiceNameConstants.KETTLE_SERVICE, fallbackFactory = RemoteKettleTransFallbackFactory.class)
public interface RemoteKettleTransService {

    /**
     * 根据条件查询转换列表
     *
     * @param req {@link QueryHelper}
     * @return {@link Result}
     */
    @PostMapping("/trans/findTransListByPage.do")
    Result<PageOut<TransRes>> findTransListByPage(@RequestBody QueryHelper<TransReq> req);

    /**
     * 全部启动
     *
     * @return {@link Result}
     */
    //@ApiOperation(value = "全部启动")
    @GetMapping("/trans/startAllTrans.do")
    Result startAllTrans();

    /**
     * 单个启动
     *
     * @param id 根据id查询
     * @return {@link Result}
     */
    //@ApiOperation(value = "单个启动")
    @GetMapping("/trans/startTrans.do")
    Result startTrans(@RequestParam("id") Integer id);

    /**
     * 全部停止
     *
     * @return {@link Result}
     */
    //@ApiOperation(value = "全部停止")
    @GetMapping("/trans/stopAllTrans.do")
    Result stopAllTrans();

    /**
     * 单个停止
     *
     * @param id 根据id查询
     * @return {@link Result}
     */
    //@ApiOperation(value = "单个停止")
    @GetMapping("/trans/stopTrans.do")
    Result stopTrans(@RequestParam("id") Integer id);



}
